﻿function contentPageLoad() {
    if (typeof ($) != 'undefined')
        $(document).bind('keydown', HotKeysModal);
    setFocus();
    //setInterval(setFocus, 3000);
}

function setFocus() {
    if (isPostBack == false)
        $get(txtNombre).focus()
}

function Regresar() {
    window.parent.ClosePopUp(null);
}

function onClosedMsg() {
    Regresar();
}

function HotKeysModal(event) {
    //ctrl + G
    if (event.ctrlKey && event.which == 71) {
        if (typeof (btnGuardar) != 'undefined') {
            $get(btnGuardar).click();
            return false;
        }
    }

    //ctrl + C
    if (event.ctrlKey && event.which == 67) {
        if (typeof (btnCerrar) != 'undefined') {
            $get(btnCerrar).click();
            return false;
        }
    }

    //esc
    if (event.which == 27) {
        if (typeof (btnCerrar) != 'undefined') {
            $get(btnCerrar).click();
            return false;
        }
    }
}